package gwt.example.client.celllist;

import java.util.Arrays;
import java.util.List;

import com.google.gwt.cell.client.TextCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.uibinder.client.UiField;

public class SimpleCellList extends Composite {

	private static SimpleCellListUiBinder uiBinder = GWT
			.create(SimpleCellListUiBinder.class);
	
	@UiField(provided=true) CellList<String> cellList;

	interface SimpleCellListUiBinder extends UiBinder<Widget, SimpleCellList> {
	}

	private static final List<String> DAYS = Arrays.asList("Sunday", "Monday",
			"Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

	
	public SimpleCellList() {
		
		// kiểu hiện thị là text cell
		TextCell styleCell = new TextCell();
		
		// tạo celllist với style là styleCell
		cellList = new CellList<String>(styleCell);	
		
		// gán row size và data		
		cellList.setRowCount(DAYS.size());
		cellList.setRowData(DAYS);				
		initWidget(uiBinder.createAndBindUi(this));
	}

	
	
}
